package com.fesine.ch02.synchronizedUpdateNewValue;

/**
 * @description: 类描述
 * @author: Fesine
 * @createTime:2016/7/15 11:18
 * @update:修改内容
 * @author: Fesine
 * @updateTime:2016/7/15 11:18
 */
public class Service {
    private boolean isContinueRun = true;
    public void runMethod() {
        String anything = new String();
        while (isContinueRun) {
            synchronized (anything) {

            }
        }
        System.out.println("停下来了！");
    }

    public void stopMethod() {
        isContinueRun = false;
    }
}
